<html>
     <head>
      <meta charset="utf-8">
 	 <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>QQ登录跳转</title>
        <script src="http://lib.sinaapp.com/js/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
        <!-- <script src="http://qzonestyle.gtimg.cn/qzone/openapi/qc_loader.js" type="text/javascript"></script> -->
     </head>
     
     <body>
          <!-- 	<p>AccessToken:<span id="accessToken"></span>--ExpireIn<span id="expire"></span></p>
            <p>OpenID:<span id="openid"></span></p> -->
           <p>页面跳转中。。。</p>
     
     <!-- 执行脚本 -->
     <script type="text/javascript">
     
     //应用的APPID
     var appID = "101031302";
     //初始构造请求
     if (window.location.hash.length == 0){
	    var redirectURI = "http://www.tgbbtt.com/rear-manage/indexQQ.html";
        var path = 'https://graph.qq.com/oauth2.0/authorize?';
        var queryParams = ['client_id=' + appID,
                           'redirect_uri=' + redirectURI,
                           'scope=' + 'get_user_info,list_album,upload_pic,add_feeds,do_like','response_type=token'];

        var query = queryParams.join('&');
        var url = path + query;
        window.location.href= url;
     } //在成功授权后回调时location.hash将带有access_token信息，开始获取openid
     else{
        //获取access token
        QC.Login.getMe(function(openId, accessToken){
        	loginQQ(accessToken, openId);
        	
       });
     }
     </script>
     
     <script src="statics/libs/jquery.min.js"></script>
             <script type="text/javascript">
        function loginQQ(accessToken,openid){
        	$.ajax({
				type: "GET",
			    url: "sys/login/qq"+"?access_token=" + accessToken + "&openid=" + openid,
			    dataType: "json",
			    success: function(result){
			    	console.info(result);
					if(result.code == 0){//登录成功
						parent.location.href ='index.html';
					}else{
						vm.error = true;
						vm.errorMsg = result.msg;
						vm.refreshCode();
					}
				}
			});        
        }
        </script>
     </body>
</html>